<div id="desc" style="display: none;">
{if $smarty.const.CAN_EDIT}
    {if !$new_present}
    <div id="p_view">
        <center><h3>{$current_gift.name}</h3></center>
        <div class="desc_body">
            {if $presenters_list}
                {if $current_gift.gived_total > 0}
                <div class="container" style="width: 100%;">
                    <div class="desc_btn" id="info_btn"><a>{$lang.show_presenters_btn}</a></div>
                    <div class="desc_btn" style="float: right;"><a>{$lang.del_present_btn}</a></div>
                    <div class="desc_info">
                        <ol>
                            <li>&nbsp;</li>     
                            <li>&nbsp;</li>     
                            {if $current_gift.amount_proposed > 0}
                            <li><b>{$lang.proposed}</b></li>
                            {foreach from=$presenters_list.N item=person}<li id="sub"><a href="{$current_location}/{$person.idusers}">{$person.first_name} {$person.last_name}{if $person.login} ({$person.login}){/if}</a> {if $person.amount > 1}({$person.amount}){/if}</li>{/foreach}
                            {/if} 
                            {if $current_gift.amount_approved > 0}
                            <li><b>{$lang.approved}</b></li>
                            {foreach from=$presenters_list.A item=person}<li id="sub"><a href="{$current_location}/{$person.idusers}">{$person.first_name} {$person.last_name}{if $person.login} ({$person.login}){/if}</a> {if $person.amount > 1}({$person.amount}){/if}</li>{/foreach}
                            {/if}
                            {if $current_gift.amount_presented > 0}
                            <li><b>{$lang.presented}</b></li>
                            {foreach from=$presenters_list.P item=person}<li id="sub"><a href="{$current_location}/{$person.idusers}">{$person.first_name} {$person.last_name}{if $person.login} ({$person.login}){/if}</a> {if $person.amount > 1}({$person.amount}){/if}</li>{/foreach}
                            {/if}
                            {if $current_gift.amount > 1}
                            <li>&nbsp;</li>
                            <li style="color: gray;">{$lang.need_amount} {$current_gift.amount}{if $current_gift.amount_left > 0}{$lang.actual_amount} {$current_gift.amount_left}{else} {$lang.all_accepted}{/if}</li>
                            {/if}
                        </ol>
                    </div>
                </div>
                {/if}
            {else}<div class="desc_btn" id="edit_btn"><a>{$lang.edit_present_btn}</a></div>
            {/if}
        {if $current_gift.ev_name}
            <table>
            <tr>
                <td class="ev_date">{$current_gift.ev_date}</td>
                <td class="ev_name">{$current_gift.ev_name}</td>
            </tr>
            </table><p>&nbsp;</p>
        {/if}
        {if $current_gift.link}
            <a href="{$current_location}/{$index_script}?{$place_name}=out&link={$current_gift.link_hash}" rel="nofollow">{$current_gift.short_link}</a>
            <br><br>
        {/if}
            {$current_gift.description}
        </div>
       {* <div class="give_btn" style="float: right; margin-top: -10px;">{$lang.edit_present_btn}</div>*}
     </div>
     
     {/if}
     
     <div id="p_edit" {if !$new_present}style="display: none;"{/if}>   
        <form accept-charset="utf-8" action="{$current_location}/{$index_script}?id={$smarty.session.id}&{$place_name}=presents_ajax&{$mode_name}=add&ajax=yes" name="new_present_form" id="present_form" method="{$form_method}">
        <input type="hidden" name="prid" value="{$current_gift.idpresents}">
        <input type="hidden" name="pr[idevent]" value="{$current_gift.idevent}">
        <input class="input-text" name="pr[name]" maxlength="100" style="width: 78%; font-weight: bold;" value="{$current_gift.name}" title="{$lang.pr_name_hint}" />
        <input class="input-text" name="pr[amount]" maxlength="100" style="width: 16%;" value="{$current_gift.amount}" title="{$lang.pr_count_hint}" />
        <input class="input-text" name="oc[name]" maxlength="190" style="width: 78%;" value="{$current_gift.ev_name}" title="{$lang.pr_occasion_hint}" />
        <input class="input-text" name="oc[date]" maxlength="10" style="width: 16%;" value="{$current_gift.ev_date}" title="{$lang.pr_occasion_date_hint}" id="calendar" />
        <input class="input-text" name="pr[link]" maxlength="100" style="width: 97.5%;" value="{$current_gift.link}" title="{$lang.pr_link_hint}" />
        <textarea name="pr[description]" style="width: 100%; height: 0px;" title="{$lang.pr_desc_hint}">{if $current_gift.description}{$current_gift.description}{else}{$lang.pr_desc_hint}{/if}</textarea>
        <br><br>
        
   {*     <fieldset>
            <legend>{$lang.who_can_view}</legend>
            <input type="radio" name="who_can_view" value="all" checked="checked">&nbsp;{$lang.view_all}<br>
            <input type="radio" name="who_can_view" value="reg" >&nbsp;{$lang.view_reg}<br>
            <input type="radio" name="who_can_view" value="friends" >&nbsp;{$lang.view_all}<br>
            <input type="radio" name="who_can_view" value="id_" >&nbsp;{$lang.view_all}<br> 
            <input type="radio" name="who_can_view" value="me" >&nbsp;{$lang.view_me}        
        </fieldset>

        <fieldset>
            <legend>{$lang.who_can_give}</legend>
            <input type="radio" name="who_can_give" value="reg" >&nbsp;{$lang.view_reg}<br>
        </fieldset>
        <br><br>       *}
        
        
        <center>
        {if !$new_present}
            {include file="button.tpl" name=$lang.edit_present_btn submit=true}
            {include file="button.tpl" href="pre_delete($current_user, `$current_gift.idpresents`);" name=$lang.del_present_btn}
        {else}
            {include file="button.tpl" name=$lang.add_present_btn submit=true}
        {/if}
        
        </center>
        </form>
     </div>
{else}
    <center><h3>{$current_gift.name}</h3></center>
    <div class="desc_body">
    {if $current_gift.ev_name}
        <table>
        <tr>
            <td class="ev_date">{$current_gift.ev_date}</td>
            <td class="ev_name">{$current_gift.ev_name}</td>
        </tr>
        </table><p>&nbsp;</p>
    {/if}
                                                                       
    
    
  {*  {if $can_give == ""} <div class="give_btn" title="{$lang.give_hint}">{$lang.give}</div>
    {elseif $present.mygift_approved == "N"} <div class="give_btn.me_proposed" title="{$lang.me_proposed_hint}">{$lang.me_proposed}</div>
    {elseif $present.mygift_approved == "A"} <div class="give_btn.me_approved" title="{$lang.me_approved_hint}">{$lang.me_approved}</div>
    {elseif $present.mygift_approved == "P"} <div class="give_btn.me_presented" title="{$lang.me_gived_hint}">{$lang.me_gived}</div>
    {elseif $present.amount_presented >= $present.amount} <div class="give_btn.other_presented" title="{$lang.other_gived_hint}">{$lang.gived}</div>
    {elseif $present.amount_presented >= $present.amount} <div class="give_btn.other_presented" title="{$lang.other_gived_hint}">{$lang.gived}</div>}
    {else} <div class="give_btn.error" title="{$can_give}">{$lang.cant_give_btn}</div>
    {/if}   *}     
    
    
    {if $can_give == ""} <div class="give_btn">{$lang.give}</div>
    {else}<div class="give_btn error">{$can_give}</div>{/if}
    
    <br><br>
    
    <form name="give_form">
    <div class="msg_bg"></div>
    <div class="give_form">
        <table>
            <tr>
                <td width="100%" align="left" style="color: silver;">{$lang.give}</td><td><img class="msg_close" src="{$skin_images_dir}/close_icon.gif"></td>
            </tr>
        </table>
        <br>
        {if $can_give == ""}
        {if $current_gift.amount > 1}
        <p><label>{$lang.gift_amount}: </label><strong>{$current_gift.amount}</strong></p>
        <p><label>{$lang.gift_amount_left}: </label><strong>{$current_gift.amount_left}</strong></p>
        <br>
        {$lang.gift_ill_give}:&nbsp;
        <input id="give_count" name="give_count" maxlength="10" value="1" style="width: 40px; text-align: center;" onfocus="this.select();">
        <br><br>        
        {/if}
        <b>{$lang.gift_really}</b>
        <p id="btn" title="{$lang.gift_btn_hint}">{include file="button.tpl" href="give(`$current_gift.idpresents`, `$current_gift.amount`);" name=$lang.gift_confirm_btn}</p>
        {else}
        <b>{$can_give}</b>
        {/if}
    </div>
    </form>
        
    
    {if $current_gift.link}
        <a href="{$current_location}/{$index_script}?{$place_name}=out&link={$current_gift.link_hash}" rel="nofollow">{$current_gift.short_link}</a>
        <br><br>
    {/if}
        {$current_gift.description}
    </div>
{/if}
</div>  